package statemode;

import buildermode.Zh0202Player;

/**
 * @author: zh
 * @date: 2021/12/17 21:10
 * @version: 1.0
 */
public abstract class Zh0202State {
    protected int blood;
    protected boolean isReady;
    protected Zh0202Player player;

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    public boolean isReady() {
        return isReady;
    }

    public void setReady(boolean ready) {
        isReady = ready;
    }

    public Zh0202Player getPlayer() {
        return player;
    }

    public void setPlayer(Zh0202Player player) {
        this.player = player;
    }

    /**
     * +   startGame()
     * +   shoot()
     * +   move()
     * +   attacked()
     * +   wait()
     */
    public void startGame(){
        System.out.println("准备开始游戏");
        isReady = true;
    }
    public void shoot(){
        System.out.println("发射子弹！！嘟嘟嘟！！");
    }
    public void move(){
        System.out.println("正在移动！");
    }
    public void attacked(){
        System.out.println("我们正在遭受攻击");
        blood -= 40;
        this.checkState();
    }
    public void waiting(){
        System.out.println("等待游戏结束");
    }

    public abstract void checkState();
}
